<?php

/**
 * Object/User.php
 */

namespace Ticket\Model\Object;

/**
 * Utilisateur
 */
class User extends XObject {

    public $id;
    public $name;
    public $login;
    public $password;
    public $email;

    /**
     * Contructeur
     * 
     * @param array $data
     */
    public function __construct($data = array()) {
        $this->exchangeArray($data);
    }

    /**
     * Remplissage des données
     * 
     * @param array $data
     */
    public function exchangeArray($data) {
        $this->id = isset($data['id']) ? (int) $data['id'] : null;
        $this->name = isset($data['name']) ? $data['name'] : '';
        $this->login = isset($data['login']) ? $data['login'] : '';
        $this->password = isset($data['password']) ? $data['password'] : '';
        $this->email = isset($data['email']) ? $data['email'] : '';
    }
}
